<template>
	<view class="content" >
		<view v-if="show_main" class="main" >
			<view class="f32 mt100" style="height: 300rpx;text-align: center;">
				<view><image :src="result.user_pic" style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image></view>
				<view>{{result.user_name}}</view>
				<view style="color:red;">{{result.virtual_coin_name}}({{result.amount}})</view>
			</view>
			<view class="disfr-lr f32 ph30 bbo" style="padding-bottom: 15rpx;">
				<view>数量({{result.receive_num}}/{{result.num}})</view>
				<view class="f28">{{result.add_time_str}}</view>
			</view>
			
			<view v-for="(item,index) in result.list" class="disfr-lr f32 ph30 mt30">
				<view class="f30 disf" >
					<image :src="item.user_pic" style="width: 50rpx;height: 50rpx; border-radius: 50%;"></image>
					<text class="toell pr" style="display: inline-block;width: 230rpx;top:5rpx;left:3rpx;">{{item.nickname}}</text>
				</view>
				<view>{{item.amount}}</view>
				<view class="f28">{{item.receive_time_str}}</view>
			</view>
			
		</view>
		
		<loading :loading="not_load"/><!--加载状态-->
	</view>
</template>

<script setup>
import { onLoad, onShow, onHide, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
import { ref } from 'vue';	
const show_main=ref(true);
const page_load=ref(false);
const not_load=ref(false);
const result=ref({});
//页面加载时
onLoad(async (options)=>{
    loadPage(options,false);
});
//页面显示时执行
onShow(()=>{
	//console.log('语法糖onShow');
});
//页面隐藏时执行
onHide(()=>{
	//console.log('语法糖onHide');
});
/**
 * 加载接口数据
 * @param {Object} options  参数,对像数组
 * @param {Object} isPage   是否加载大于1页
 */
const loadPage=async (options,isPage)=>{
	let ret = await uni.$get('/appapi-redpacket-groupredpacket',options);
	console.log(ret);
	if(ret.error_code != 0){
		uni.$utils.showToast(ret.info);
		return;
	}
	uni.setNavigationBarTitle({ title: ret.data.title });
	show_main.value=true;
	not_load.value=true;
	result.value=ret.data;
};
/**
 * 模板属性跳转页面
 * @param {Object} e
 */
function goPage(event){
	topDropDownShow.value=false;
	uni.$utils.dataSetPage(event);
};

</script>

<style  lang="scss">
	page {
		background: #fff;
	}

</style>
